package com.byronspace.web;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloController {
    
    @ResponseBody
    @RequestMapping("/hello")
    public String hello() {
        return "Hello World";
    }

    @RequestMapping("/")
    public String index(ModelMap map) {
        map.addAttribute("host", "欢迎来到滨哥世界");
        return "index";
    }
    @RequestMapping("/errorPage")
    public String errorPage(ModelMap map) {
        map.addAttribute("errorMsg", "参数不齐全");
        return "errorPage/404";
    }

}